using IcsSEMCtrl.Util;
using System;
namespace Lifter.Global.Device
{
	public class VehicleState
	{
		public const int _NONE = 0;
		public const int _REMOVED = 1;
		public const int _NOTASSIGNED = 2;
		public const int _ENROUTE = 3;
		public const int _PARKED = 4;
		public const int _ACQUIRING = 5;
		public const int _DEPOSITING = 6;
		public const int _ASSIGNED = 7;
		private int _value;
		private static int _size;
		private static VehicleState[] _array;
		public static string[] displayStrings;
		public static VehicleState[] displayValues;
		public static VehicleState NONE;
		public static VehicleState REMOVED;
		public static VehicleState NOTASSIGNED;
		public static VehicleState ENROUTE;
		public static VehicleState PARKED;
		public static VehicleState ACQUIRING;
		public static VehicleState DEPOSITING;
		public static VehicleState ASSIGNED;
		public static VehicleState IT_ENUM_MAX;
		static VehicleState()
		{
			VehicleState._size = 8;
			VehicleState._array = new VehicleState[VehicleState._size];
			VehicleState.displayStrings = new string[VehicleState._size];
			VehicleState.displayValues = new VehicleState[VehicleState._size];
			VehicleState.NONE = new VehicleState(0);
			VehicleState.REMOVED = new VehicleState(1);
			VehicleState.NOTASSIGNED = new VehicleState(2);
			VehicleState.ENROUTE = new VehicleState(3);
			VehicleState.PARKED = new VehicleState(4);
			VehicleState.ACQUIRING = new VehicleState(5);
			VehicleState.DEPOSITING = new VehicleState(6);
			VehicleState.ASSIGNED = new VehicleState(7);
			VehicleState.IT_ENUM_MAX = new VehicleState(2147483647);
			VehicleState.displayStrings[0] = "NONE";
			VehicleState.displayStrings[1] = "REMOVED";
			VehicleState.displayStrings[2] = "NOTASSIGNED";
			VehicleState.displayStrings[3] = "ENROUTE";
			VehicleState.displayStrings[4] = "PARKED";
			VehicleState.displayStrings[5] = "ACQUIRING";
			VehicleState.displayStrings[6] = "DEPOSITING";
			VehicleState.displayStrings[7] = "ASSIGNED";
			VehicleState.displayValues[0] = VehicleState.NONE;
			VehicleState.displayValues[1] = VehicleState.REMOVED;
			VehicleState.displayValues[2] = VehicleState.NOTASSIGNED;
			VehicleState.displayValues[3] = VehicleState.ENROUTE;
			VehicleState.displayValues[4] = VehicleState.PARKED;
			VehicleState.displayValues[5] = VehicleState.ACQUIRING;
			VehicleState.displayValues[6] = VehicleState.DEPOSITING;
			VehicleState.displayValues[7] = VehicleState.ASSIGNED;
		}
		public static string ValueToString(VehicleState val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = VehicleState.displayStrings[0];
				break;
			case 1:
				result = VehicleState.displayStrings[1];
				break;
			case 2:
				result = VehicleState.displayStrings[2];
				break;
			case 3:
				result = VehicleState.displayStrings[3];
				break;
			case 4:
				result = VehicleState.displayStrings[4];
				break;
			case 5:
				result = VehicleState.displayStrings[5];
				break;
			case 6:
				result = VehicleState.displayStrings[6];
				break;
			case 7:
				result = VehicleState.displayStrings[7];
				break;
			default:
				result = "";
				break;
			}
			return result;
		}
		public static VehicleState StringToValue(string val)
		{
			VehicleState result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = VehicleState.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < VehicleState.displayStrings.Length; i++)
				{
					if (val.Equals(VehicleState.displayStrings[i]))
					{
						result = VehicleState.displayValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static VehicleState From_Int(int value)
		{
			VehicleState result;
			if (value >= 0 && value < VehicleState._size)
			{
				result = VehicleState._array[value];
			}
			else
			{
				result = VehicleState.IT_ENUM_MAX;
			}
			return result;
		}
		protected VehicleState(int value)
		{
			this._value = value;
			if (value >= 0 && value < VehicleState._size)
			{
				VehicleState._array[this._value] = this;
			}
		}
		public bool Equals(VehicleState otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return VehicleState.displayStrings[this._value];
		}
	}
}
